package com.etc.myblog.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Comment {
	private int commentId;
	private Article article;
	private User user;
	private String commentContent;
	private Date commentTime;
	private int commentClick;
	
	public Comment() {
		super();
	}
	public Comment(int commentId) {
		super();
		this.commentId = commentId;
	}
	public int getCommentId() {
		return commentId;
	}
	public void setCommentId(int commentId) {
		this.commentId = commentId;
	}
	public Article getArticle() {
		return article;
	}
	public void setArticle(Article article) {
		this.article = article;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getCommentContent() {
		return commentContent;
	}
	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}
	public String getCommentTime() {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		   String dateString = formatter.format(commentTime);
		   return dateString;
	}
	public void setCommentTime(Date commentTime) {
		this.commentTime = commentTime;
	}
	public int getCommentClick() {
		return commentClick;
	}
	public void setCommentClick(int commentClick) {
		this.commentClick = commentClick;
	}
	@Override
	public String toString() {
		return "Comment [commentId=" + commentId + ", article=" + article
				+ ", user=" + user + ", commentContent=" + commentContent
				+ ", commentTime=" + commentTime + ", commentClick="
				+ commentClick + "]";
	}
}
